int posX = 240;
int posY = 160;
int velX = 2;
int velY = 2;

void setup() {
  size(480, 320);
  smooth();
  fill(200, 100, 100);
}

void draw() {
	background(55, 55, 55);
	
	// Move the ball.
	posX = posX + velX;
	posY = posY + velY;
	if (posX < 0) {
		velX = velX * -1;
		posX = 0;
	}
	if (posY < 0) {
		velY = velY * -1;
		posY = 0;
	}
	if (posX > 480) {
		velX = velX * -1;
		posX = 480;
	}
	if (posY > 320) {
		velY = velY * -1;
		posY = 320;
	}	
	ellipse(posX, posY, 100, 100);
}

String getPosition() {
	return posX + " " + posY;
}
